-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[ui] Improve global search perf #16965
Conversation
Current dependencies on/for this PR:
This comment was auto-generated by Graphite. |
Deploy preview for dagit-core-storybook ready! ✅ Preview Built with commit b338d2e. |
fe5c773
to
b338d2e
Compare
Deploy preview for dagit-storybook ready! ✅ Preview Built with commit b338d2e. |
// With a very large number of runs, operating on the Apollo cache is too expensive and | ||
// can block the main thread. This data has to be up-to-the-second fresh anyway, so just | ||
// skip the cache entirely. | ||
fetchPolicy: 'no-cache', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍🏾
Summary & Motivation
Improve render and interaction performance on global search for users with very large workspaces.
A key part of the problem here is that writing/reading with the Apollo cache becomes prohibitively slow at scale. Therefore:
cache-first
policy on search queries. Currently, we always hit the backend when opening search, which can be expensive both in terms of performing the query and updating the cache. Instead, we can leverage the workspace and asset catalog queries to read data from the Apollo cache, if available.How I Tested These Changes
Viewing the app as a user with tens of thousands of objects, open search after the workspace and asset catalog have loaded. Verify that new queries are not performed, and that the data is available to be searched as soon as the cache has populated the values. Close search, reopen it. Verify that search is available right away, without having to wait for the cache to populate the values.